<?php
/**
 * Created by PhpStorm.
 * User: gzc0918
 * Date: 2021-08-06
 * Time: 23:24
 */

namespace IMooc;
//申明适配器接口
interface IDatabase
{
    function connect($host, $user, $passwd, $dbname);
    function query($sql);
    function close();
}

class Database
{
    //链式调用，链式调用的秘诀就是在方法中return $this
    public function where($where)
    {
        return $this;
    }
    public function limit($limit)
    {
        return $this;
    }
    public function order($order)
    {
        return $this;
    }
}